using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace FrameWork.Inventory
{
    public class ShopSlot : MonoBehaviour
    {
        // 物品
        [field: SerializeField] private ItemSO item;
        // 组件
        [SerializeField] private Button button;
        // 物品图片
        [SerializeField] private Image itemImage;
        // 测试
        [SerializeField] private string itemName;

        private void OnEnable()
        {
            button.onClick.AddListener((() =>
            {
                ShopDescription.Instance.SetDescription(item);
            }));
            
            itemName = item.ItemName;
            itemImage.gameObject.SetActive(true);
            itemImage.sprite = item.ItemIcon;
        }
    }
}
